package com.operation.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.operation.PROJECT_URL;
import com.operation.form.UserForm;
import com.operation.service.UserService;

/**
 * Handles requests for the application home page.
 */
@Controller
@RequestMapping(PROJECT_URL.MOBILE + "/user")
public class UserController extends SuperController{
	@Resource
	private UserService userService;
	
	@RequestMapping(value = "/userTest", method = RequestMethod.GET)
	public ModelAndView mybatis(HttpServletRequest request, UserForm form,
			BindingResult errors, ModelMap model) {		
		
		ModelAndView mav = new ModelAndView();
		mav.addObject("mybatis", userService.mybatis(form));    
		mav.setViewName("JSON");
		return mav;
	}	
}
